package jjn.round1;

/**
 * @author Jjn
 * @since 2022/10/2 14:30
 */
public class LeetCode171_ExcelSheetColumnNumber {
    public int titleToNumber(String columnTitle) {
        if (columnTitle == null) {
            return 0;
        }
        int total = 0;
        for (Character c : columnTitle.toCharArray()) {
            total = total * 26 + (c - 'A' + 1);
        }
        return total;
    }

}
